
precision lowp float;
varying vec2 vUv;
varying vec4 vPosition;
varying vec3 gPosition;
uniform sampler2D uTexture;

void main(){
    // gl_FragColor = vec4( vUv , 0.0 , 1.0 );
    vec4 redColor = vec4(1.0,0.0,0.0,1.0);
    vec4 yellowColor = vec4(1.0,1.0,0.0,1.0);
    // 根据 y 轴 从上到下 渲染过度 redColor 到 yellowColor
    vec4 mixColor = mix(yellowColor,redColor,gPosition.y / 1.0);

    // 判断是否正面
    if(gl_FrontFacing){
        gl_FragColor = vec4(mixColor.xyz - vPosition.y/100.0 - 0.1,1.0);
    }else{
        gl_FragColor = vec4(mixColor.xyz,1.0);
    }
}